﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace xab
{


    public interface IRulePreview
    {
        void AddBundleInfo(BundleInfo info);
    }



    [Serializable]
    public class RulePreview : IRulePreview
    {

        /// <summary>
        /// 某条规则产生的所有Bunde包
        /// </summary>
        public List<BundleInfo> _bundles = new List<BundleInfo>();

        public void AddBundleInfo(BundleInfo info)
        {
            if (!_bundles.Contains(info))
            {
                _bundles.Add(info);
            }
        }

    } //end of class



    [Serializable]
    public class ExplicitRulePreview : IRulePreview
    {

        /// <summary>
        /// 某条规则产生的所有Bunde包
        /// </summary>
        public List<BundleInfo> _bundles = new List<BundleInfo>();

        public ExplicitRulePreview()
        {
        }

        public void AddBundleInfo(BundleInfo info)
        {
            if (!_bundles.Contains(info))
            {
                _bundles.Add(info);
            }
        }

    } //end of class



    [Serializable]
    public class FileNameRulePreview : IRulePreview
    {

        /// <summary>
        /// 某条规则产生的所有Bunde包
        /// </summary>
        public List<BundleInfo> _bundles = new List<BundleInfo>();

        public void AddBundleInfo(BundleInfo info)
        {
            if (!_bundles.Contains(info))
            {
                _bundles.Add(info);
            }
        }

    } //end of class



}

